import java.util.Iterator;


public class Test_MaxHeap {

	/**
	 * @author sam jenkins
	 */
	public static void main(String[] args) 
	{
		MaxHeap mHeap = new MaxHeap();
		System.out.println("Complete? " + mHeap.isFull());
		System.out.println("Qty: " + mHeap.sizeOfHeap() + "\n");
		// post the name of the test program
		//System.out.println("\tMaxHeapTester.java");				

		int qty = 7;
		ProcessGenerator pg1 = new ProcessGenerator(1);
		for( int i = 0 ; i < qty ; i++ )
		{
			mHeap.insert( pg1.getNewProcess(i+1,20,9) );
		}
		
		System.out.println("\nHeight of Heap: " + mHeap.heightOfHeap());
		System.out.println("Complete? " + mHeap.isFull());
		System.out.println("Size: " + mHeap.sizeOfHeap());
		
		/*
		System.out.println();
		Iterator itr2 = mHeap.heapItr();
		while(itr2.hasNext())
			System.out.println(itr2.next());
		*/
		
		/*
		System.out.println("\nQty: " + mHeap.sizeOfHeap());
		System.out.println("Last node: " + mHeap.lastNode());
		
		System.out.println("");
		for( int i = 0 ; i < qty ; i++ )
		{
			System.out.println((Process)mHeap.remove());
		}
		System.out.println("\nQty: " + mHeap.sizeOfHeap());
		*/
		// System.out.print("Finished  Finished  Finished  Finished  Finished  Finished  Finished  Finished");

		
	}
	public static void testIsEmpty()
	{
		System.out.println("testing MaxHeap isEmpty() method");
		
		System.out.println("\tTesting the MaxHeap empty constructor");
		MaxHeap mHeap1 = new MaxHeap();
		mHeap1.isEmpty();
		System.out.println("\t\tIs it empty? " + mHeap1.isEmpty());
		
		System.out.println("\tTesting the MaxHeap empty constructor\n\tafter adding data:");
		Process process = new Process(1,1,1);
		mHeap1.insert(process);
		System.out.println("\t\tIs it empty? " + mHeap1.isEmpty());
		//System.out.println("\t\tHow many items in MaxHeap: " + mHeap1.sizeOfHeap());
		

		System.out.println("\tTesting the MaxHeap non empty constructor using a Process");		
		Process process2 = new Process(1,1,1);
		MaxHeap mHeap2 = new MaxHeap(process2);
		System.out.println("\t\tIs it empty? " + mHeap2.isEmpty());
		
		
	}
	private static MaxHeap createMaxHeapWithData(int dataQty)
	{
		MaxHeap mHeap = new MaxHeap();
		for( int i = 0 ; i < dataQty ; i++ )
		mHeap.insert(new Process( i , 1 , 1 ));
		return mHeap;
		
	}
}